<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>08_面向对象-组合继承</title>
    </head>
    <body>
        <script>
            function Dog(name,age){
                this.name = name;
                this.age = age;
            }
            Dog.prototype.run = function(){
                console.log(1111);
            }

            
            function Teddy(name,age){
                Dog.call(this,name,age);
            }

            Teddy.prototype = new Dog();
            Teddy.prototype.constructor = Teddy;


            function Koki(name,age){
                Dog.call(this,name,age);
            }

            Koki.prototype = new Dog();
            Koki.prototype.constructor = Koki;

            var tt = new Teddy('怼怼',3);
            tt.run();

            var kk = new Koki('短短',4);
            kk.run();

            console.log(tt.run == kk.run);
        </script>
    </body>
</html>